package com.pc.web;

import java.util.Locale;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class HomeController {
	
	private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
	
	@Autowired private HomeDao dao;
	@Autowired private HomeService service;
	@RequestMapping(value = "/", method = RequestMethod.GET)
	public String home(Locale locale, Model model) {
		logger.info("Welcome home! The client locale is {}.", locale);
		
		service.categoryList(model);
		
		return "home";
	}
	
	@RequestMapping(value = "/useInfo", method = RequestMethod.GET)
	public String UseInfo(Locale locale, Model model){
		logger.info("Welcome UseInfo! The client locale is {}.", locale);
		
		service.categoryList(model);
		
		return "content/useInfo";
	}
	
	@RequestMapping(value = "/uselaw", method = RequestMethod.GET)
	public String Uselaw(Locale locale, Model model){
		logger.info("Welcome Uselaw! The client locale is {}.", locale);
		
		service.categoryList(model);
		
		return "content/uselaw";
	}
	
	@RequestMapping(value = "/privacy", method = RequestMethod.GET)
	public String Privacy(Locale locale, Model model){
		logger.info("Welcome Privacy! The client locale is {}.", locale);
		
		service.categoryList(model);
		
		return "content/privacy";
	}
	
	@RequestMapping(value = "/price", method = RequestMethod.GET)
	public String Category_price(Locale locale, Model model){
		logger.info("Welcome Category_price! The client locale is {}.", locale);
		
		service.categoryList(model);
		
		return "category/category_price";
	}
	
	@RequestMapping(value = "/ssd", method = RequestMethod.GET)
	public String ssd(Locale locale, Model model){
		logger.info("Welcome ssd! The client locale is {}.", locale);
		
		service.categoryList(model);
		
		return "content/ssd";
	}
}
